package cn.tpshion.devops.node.support;

import cn.tpshion.devops.node.Node;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import java.util.List;

@Component
public class NodeFactory {

    @Autowired
    private List<Node> nodeList;

    public Node getNode(String type){
        for (Node node : nodeList) {
            if(node.getType().equals(type)){
                return node;
            }
        }
        return null;
    }
}
